1. Field of the Invention
The present invention relates to business object management and more particularly to business object cloning.
2. Description of the Related Art
A business object is a type of an intelligible entity being an actor inside the business layer in an n-layered architecture of object-oriented computer programs. A business object generally includes no logic, but merely a set of instance variables or properties, often referred to as attributes, as well as associations with other business objects. Therefore, a collection of different business objects which reference one another in some way can result in a business object graph of different business objects representative of business relationships of people, processes and products within a single organization, between different organizations, or both.
Oftentimes, it is desirable to copy a business object for use a copied entity separate from the original business object. For instance, in many cases it can be desirable to duplicate a business object and then manipulate attributes of the duplicated business object without affecting the original business object. To effectuate a copy, the attributes of the business object are copied to a different object of the same data type. The act of copying, also known as cloning or replicating, can vary from merely duplicating all of the attributes of the source business object into a target business object, or in a more complex operation, duplicating not only the attributes of the source object, but also all referenced business objects and the attributes corresponding to the referenced objects. The former operation is referred to as a “shallow” clone while the latter is referred as a “deep” clone of the entire business object graph.
With respect to a shallow copy, only basic utilization of the business object is possible as those business objects referenced by the shallow clone of the business object are not likewise duplicated and thus remain inaccessible to the shallow clone of the business object. However, with respect to a deeply cloned business object graph, all business objects referenced by others of the graph can be accessed. For instance, in a deep cloning operation, the business objects of the graph can be serialized, provided as a byte stream and de-serialized in a target memory space so as to produce a perfect copy of the business object graph. Yet, as it will be apparent, performing a deep clone of a business object graph can be computing resource consumptive, while a shallow clone of a business object can be relatively efficient.
Presently, the determination of whether or not business objects in a business object graph are to be subjected to shallow cloning or deep cloning occurs statically prior to run time. Once that determination has been made, at run time the selection of shallow cloning or deep cloning is fixed. Further, when executing a cloning operation, embedded processing logic in the application often accounts for the contemporaneous state of the source business object in order to generate a target business object graph. The contemporaneous state can include, for instance, a valid status or a security level, and can be dispositive of the number of related business objects to be included in the target business object graph and the relationship therebetween. However, given the sensitive nature of some attributes of the source business object or the relevance of those attributes to the cloned business object such as the creation date of the source business object or its unique identifier, often only a cloning of a partial state of the business object graph is desired.